<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of category_model
 * 
 * @author Joydeb Choudhury (mcajoydeb@gmail.com)
 */
class Admin_generic_model extends CI_Model {

    //put your code here


    function __construct() {
        parent::__construct();
		$this->load->library('pagination');
        log_message('debug', 'Init Model Initialized');
    }

    //--subha
    function get_generics($num=NULL, $offset=NULL, $generic=NULL) {
		$query=" ";	
	if($generic)
		$query.= " and name=$generic";
	if($num && $offset)
	   $query.= " limit $num, $offset";	   
       $sql="select * from generic".$query;
	   $query=$this->db->query($sql);
	   $result=$query->result();
	   return $result;
    }
	function get_generic_by_id($id){
	$sql="select * from generic where id=$id";
	$query=$this->db->query($sql);
	$result=$query->row();
	if ($query->num_rows > 0) {
            return $result;
      }
	   
	
	}


}

?>